/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package business;

import dal.FlightDAL;
import java.util.List;
import model.Flight;

/**
 *
 * @author Administrator
 */
public class FlightBusiness {

    private FlightDAL flightDAL = new FlightDAL();

    public List<Flight> listAllFilght() {
        return flightDAL.listAllFight();
    }

    public boolean newFlight(Flight flight) {
        if (flightDAL.newFlight(flight)) {
            return true;
        }
        return false;
    }

    public boolean updateFlight(Flight flight) {
        if (flightDAL.updateFlight(flight)) {
            return true;
        }
        return false;
    }

    public List<Flight> searchFlightByLocation(String localName){
        return flightDAL.searchFlightByLocation(localName);
    }

    public List<Flight> searchFlightByName(String flightName){
        return flightDAL.searchFlightByName(flightName);
    }

    public List<Flight> searchFlightByDate(String dateFrom, String dateTo){
        return flightDAL.searchFlightByDate(dateFrom, dateTo);
    }

    public List<Flight> advanceSearchFlight(String departLocal ,String arrivalLocal , String dateFrom, String dateTo){
        return flightDAL.advanceSearchFlight(departLocal, arrivalLocal, dateFrom, dateTo);
    }
}
